package com.chushouya.order.dto.api.orderclothesproduct;

import com.general.framework.core.lang.Dates;
import com.chushouya.order.constants.OrderTypeEnum;
import com.chushouya.order.constants.UserOrderStatusEnum;
import com.chushouya.order.dto.api.order.OrderAddressApiDTO;
import com.chushouya.order.dto.api.order.OrderExtendApiDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
@ApiModel("订单旧衣商品API")
public class OrderClothesApiDTO {

    @ApiModelProperty(value = "速回收订单号")
    private String orderNo;

    @ApiModelProperty(value = "合作方订单号")
    private String partnerOrderNo;

    @ApiModelProperty(value = "产品名")
    private String productName;

    @ApiModelProperty(value = "订单状态")
    private Integer orderStatus;

    @ApiModelProperty(value = "订单状态文案")
    private String orderStatusText;

    @ApiModelProperty(value = "回收方式(1:邮寄，2:上门)")
    private Integer orderType;

    @ApiModelProperty(value = "用户手机号")
    private String userPhone;

    @ApiModelProperty(value = "用户姓名")
    private String userName;

    @ApiModelProperty(value = "预约上门时间-开始 yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date appointStartTime;

    @ApiModelProperty(value = "预约上门时间-结束 yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date appointEndTime;

    @ApiModelProperty(value = "订单估价（元）")
    private BigDecimal evaluatePrice;

    @ApiModelProperty(value = "加价金额（元）")
    private BigDecimal bonusPrice;

    @ApiModelProperty(value = "成交金额（元）")
    private BigDecimal completePrice;

    @ApiModelProperty(value = "订单金额（元）")
    private BigDecimal orderPrice;

    @ApiModelProperty("评估项目")
    private OrderClothesProductApiDTO orderClothesProduct;

    @ApiModelProperty("订单地址")
    private OrderAddressApiDTO orderAddress;

    @ApiModelProperty("订单额外信息")
    private OrderExtendApiDTO orderExtend;

    @ApiModelProperty("下单时间")
    @JsonFormat(pattern = Dates.FMT_FULL_TIME)
    private Date createTime;

    public String getOrderStatusText() {
        return UserOrderStatusEnum.getDesc(this.orderStatus);
    }

    public String getOrderTypeText() {
        return OrderTypeEnum.getDesc(this.orderType);
    }
}
